/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// IInfomationPublish interface for NHibernate mapped table 'InfomationPublish'.
	/// </summary>
	public interface IInfomationPublish
	{
		#region Public Properties
		
		int i_id
		{
			get ;
			set ;
			  
		}
		
		string i_title0
		{
			get ;
			set ;
			  
		}
		
		string i_title1
		{
			get ;
			set ;
			  
		}
		
		string i_content
		{
			get ;
			set ;
			  
		}
		
		string i_imageUrl
		{
			get ;
			set ;
			  
		}
		
		string i_imageLink
		{
			get ;
			set ;
			  
		}
		
		string i_dataLink
		{
			get ;
			set ;
			  
		}
		
		byte i_template
		{
			get ;
			set ;
			  
		}
		
		int? i_recommend
		{
			get ;
			set ;
			  
		}
		
		byte i_state
		{
			get ;
			set ;
			  
		}
		
		string i_classRule
		{
			get ;
			set ;
			  
		}
		
		string i_userRule
		{
			get ;
			set ;
			  
		}
		
		DateTime i_startTime
		{
			get ;
			set ;
			  
		}
		
		DateTime i_endTime
		{
			get ;
			set ;
			  
		}
		
		int i_user
		{
			get ;
			set ;
			  
		}
		
		DateTime i_addTime
		{
			get ;
			set ;
			  
		}
		
		int? i_lastUser
		{
			get ;
			set ;
			  
		}
		
		DateTime? i_updateTime
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// InfomationPublish object for NHibernate mapped table 'InfomationPublish'.
	/// </summary>
	[Serializable]
	public class InfomationPublish : ICloneable,IInfomationPublish
	{
		#region Member Variables

		protected int _i_id;
		protected string _i_title0;
		protected string _i_title1;
		protected string _i_content;
		protected string _i_imageurl;
		protected string _i_imagelink;
		protected string _i_datalink;
		protected byte _i_template;
		protected int? _i_recommend;
		protected byte _i_state;
		protected string _i_classrule;
		protected string _i_userrule;
		protected DateTime _i_starttime;
		protected DateTime _i_endtime;
		protected int _i_user;
		protected DateTime _i_addtime;
		protected int? _i_lastuser;
		protected DateTime? _i_updatetime;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public InfomationPublish() {}
		
		public InfomationPublish(string pititle0, string pititle1, string picontent, string piimageUrl, string piimageLink, string pidataLink, byte pitemplate, int? pirecommend, byte pistate, string piclassRule, string piuserRule, DateTime pistartTime, DateTime piendTime, int piuser, DateTime piaddTime, int? pilastUser, DateTime? piupdateTime)
		{
			this._i_title0 = pititle0; 
			this._i_title1 = pititle1; 
			this._i_content = picontent; 
			this._i_imageurl = piimageUrl; 
			this._i_imagelink = piimageLink; 
			this._i_datalink = pidataLink; 
			this._i_template = pitemplate; 
			this._i_recommend = pirecommend; 
			this._i_state = pistate; 
			this._i_classrule = piclassRule; 
			this._i_userrule = piuserRule; 
			this._i_starttime = pistartTime; 
			this._i_endtime = piendTime; 
			this._i_user = piuser; 
			this._i_addtime = piaddTime; 
			this._i_lastuser = pilastUser; 
			this._i_updatetime = piupdateTime; 
		}
		
		public InfomationPublish(byte pitemplate, byte pistate, DateTime pistartTime, DateTime piendTime, int piuser, DateTime piaddTime)
		{
			this._i_template = pitemplate; 
			this._i_state = pistate; 
			this._i_starttime = pistartTime; 
			this._i_endtime = piendTime; 
			this._i_user = piuser; 
			this._i_addtime = piaddTime; 
		}
		
		public InfomationPublish(int piid)
		{
			this._i_id = piid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int i_id
		{
			get { return _i_id; }
			set { _bIsChanged |= (_i_id != value); _i_id = value; }
			
		}
		
		public virtual string i_title0
		{
			get { return _i_title0; }
			set 
			{
			  if (value != null && value.Length > 200)
			    throw new ArgumentOutOfRangeException("i_title0", "i_title0 value, cannot contain more than 200 characters");
			  _bIsChanged |= (_i_title0 != value); 
			  _i_title0 = value; 
			}
			
		}
		
		public virtual string i_title1
		{
			get { return _i_title1; }
			set 
			{
			  if (value != null && value.Length > 400)
			    throw new ArgumentOutOfRangeException("i_title1", "i_title1 value, cannot contain more than 400 characters");
			  _bIsChanged |= (_i_title1 != value); 
			  _i_title1 = value; 
			}
			
		}
		
		public virtual string i_content
		{
			get { return _i_content; }
			set 
			{
			  if (value != null && value.Length > 2147483647)
			    throw new ArgumentOutOfRangeException("i_content", "i_content value, cannot contain more than 2147483647 characters");
			  _bIsChanged |= (_i_content != value); 
			  _i_content = value; 
			}
			
		}
		
		public virtual string i_imageUrl
		{
			get { return _i_imageurl; }
			set 
			{
			  if (value != null && value.Length > 200)
			    throw new ArgumentOutOfRangeException("i_imageUrl", "i_imageUrl value, cannot contain more than 200 characters");
			  _bIsChanged |= (_i_imageurl != value); 
			  _i_imageurl = value; 
			}
			
		}
		
		public virtual string i_imageLink
		{
			get { return _i_imagelink; }
			set 
			{
			  if (value != null && value.Length > 200)
			    throw new ArgumentOutOfRangeException("i_imageLink", "i_imageLink value, cannot contain more than 200 characters");
			  _bIsChanged |= (_i_imagelink != value); 
			  _i_imagelink = value; 
			}
			
		}
		
		public virtual string i_dataLink
		{
			get { return _i_datalink; }
			set 
			{
			  if (value != null && value.Length > 200)
			    throw new ArgumentOutOfRangeException("i_dataLink", "i_dataLink value, cannot contain more than 200 characters");
			  _bIsChanged |= (_i_datalink != value); 
			  _i_datalink = value; 
			}
			
		}
		
		public virtual byte i_template
		{
			get { return _i_template; }
			set { _bIsChanged |= (_i_template != value); _i_template = value; }
			
		}
		
		public virtual int? i_recommend
		{
			get { return _i_recommend; }
			set { _bIsChanged |= (_i_recommend != value); _i_recommend = value; }
			
		}
		
		public virtual byte i_state
		{
			get { return _i_state; }
			set { _bIsChanged |= (_i_state != value); _i_state = value; }
			
		}
		
		public virtual string i_classRule
		{
			get { return _i_classrule; }
			set 
			{
			  if (value != null && value.Length > 400)
			    throw new ArgumentOutOfRangeException("i_classRule", "i_classRule value, cannot contain more than 400 characters");
			  _bIsChanged |= (_i_classrule != value); 
			  _i_classrule = value; 
			}
			
		}
		
		public virtual string i_userRule
		{
			get { return _i_userrule; }
			set 
			{
			  if (value != null && value.Length > 600)
			    throw new ArgumentOutOfRangeException("i_userRule", "i_userRule value, cannot contain more than 600 characters");
			  _bIsChanged |= (_i_userrule != value); 
			  _i_userrule = value; 
			}
			
		}
		
		public virtual DateTime i_startTime
		{
			get { return _i_starttime; }
			set { _bIsChanged |= (_i_starttime != value); _i_starttime = value; }
			
		}
		
		public virtual DateTime i_endTime
		{
			get { return _i_endtime; }
			set { _bIsChanged |= (_i_endtime != value); _i_endtime = value; }
			
		}
		
		public virtual int i_user
		{
			get { return _i_user; }
			set { _bIsChanged |= (_i_user != value); _i_user = value; }
			
		}
		
		public virtual DateTime i_addTime
		{
			get { return _i_addtime; }
			set { _bIsChanged |= (_i_addtime != value); _i_addtime = value; }
			
		}
		
		public virtual int? i_lastUser
		{
			get { return _i_lastuser; }
			set { _bIsChanged |= (_i_lastuser != value); _i_lastuser = value; }
			
		}
		
		public virtual DateTime? i_updateTime
		{
			get { return _i_updatetime; }
			set { _bIsChanged |= (_i_updatetime != value); _i_updatetime = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			InfomationPublish castObj = null;
			try
			{
				castObj = (InfomationPublish)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._i_id == castObj.i_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _i_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for InfomationPublish 

	
	public interface IInfomationPublishCollection : ICollection
	{
		InfomationPublish this[int index]{	get; set; }
		void Add(InfomationPublish pInfomationPublish);
		void Clear();
	}
	
	[Serializable]
	public class InfomationPublishCollection : IInfomationPublishCollection
	{
		private IList<InfomationPublish> _arrayInternal;

		public InfomationPublishCollection()
		{
			_arrayInternal = new List<InfomationPublish>();
		}
		
		public InfomationPublishCollection( IList<InfomationPublish> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<InfomationPublish>();
			}
		}

		public InfomationPublish this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((InfomationPublish[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(InfomationPublish pInfomationPublish) { _arrayInternal.Add(pInfomationPublish); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<InfomationPublish> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
